cc.Class({
    extends: cc.Component,
    properties: {
        _func: null,
        _isCheck: !1,
        isCheck: {
            get: function () {
                return this._isCheck;
            },
            set: function (e) {
                this._isCheck = e, this._UpdateToggle(e);
            }
        },
        _disable: !1
    },
    InitData: function (e, t, n) {
        this.m_func = n, this.m_baseCheck = t;
    },
    SetDisable: function (e) {
        this._disable = e;
    },
    start: function () {
        this.node.on("touchend", this.OnClick, this);
        var e = Global.utils.searchNode(this.node, "Switch");
        this.switch_1 = Global.utils.searchNode(e, "Btn_Switch_Off_Bk"), this.switch_2 = Global.utils.searchNode(e, "Btn_Switch"),
            this.isCheck = this.m_baseCheck;
    },
    onDisable: function () {
        this.node.off("touchend", this.OnClick, this);
    },
    OnClick: function (e) {
        this._disable || (this.isCheck = !this.isCheck, this.m_func && this.m_func(e, this.isCheck));
    },
    _UpdateToggle: function (e) {
        this.switch_1.active = !e, this.switch_2.active = e;
    }
})
